#ifndef __SCREEN_HELPER_H__
#define __SCREEN_HELPER_H__

#include <stdint.h>

#if defined(HAS_QNX_SCREEN) && HAS_QNX_SCREEN
#include <screen/screen.h>


#define WIN_IV_END 0
#define BUF_IV_END 0
#define DISPLAY_MAX_ID 16

struct WindowInfo
{
    int32_t enable_debug; /**1: enable debug info showing on screen, 0: disable */
    int32_t useage;
    int32_t color_format; 
    int32_t rotation; /** the angle of rotation */
    int32_t display_id;  
};


int SetDisplayId(screen_context_t ctx, screen_window_t win, int32_t displayId);


/**layout: property_1|val_1 count|vals_1...|property_2|val_2 count|vals_2...|WIN_IV_END|  
 * the array need to end with WIN_IV_END
 * e.g:
 * int32_t ivs[] = {
 *        SCREEN_PROPERTY_FORMAT, 1, SCREEN_FORMAT_NV12,
 *        SCREEN_PROPERTY_POSITION, 2, posX, posY,
 *        SCREEN_PROPERTY_SIZE, 4, posX,posY, width, height,
 *        WIN_IV_END
 * };
 */
int SetWindowIVs(screen_window_t win, int32_t ivs[]);




/**layout: property_1|val_1 count|vals_1...|property_2|val_2 count|vals_2...|BUF_IV_END|  
 * the array need to end with BUF_IV_END
 * e.g:
 * int32_t ivs[] = {
 *        SCREEN_PROPERTY_FORMAT, 1, SCREEN_FORMAT_NV12,
 *        SCREEN_PROPERTY_BUFFER_SIZE, 2, width, height,
 *        BUF_IV_END
 * };
 */
int SetBufferIVs(screen_buffer_t sbuf, int32_t ivs[]);



int CreateWindow(screen_context_t ctx, screen_window_t& win, int32_t display_id, int ivs[]);


#endif /** end of HAS_QNX_SCREEN */

#endif /** !__SCREEN_HELPER_H__ */

